/*
 * @Author: moonwater 13812995013@163.com
 * @Date: 2025-02-26 11:34:17
 * @LastEditors: moonwater 13812995013@163.com
 * @LastEditTime: 2025-03-04 16:09:58
 * @FilePath: \盐师22Git仓库\HelloWorld.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
public class HelloWorld {
    public static void main(String[] args) {
        int count = 0;
        System.out.println("Prime numbers between 101 and 200 are:");
        
        for (int i = 101; i <= 200; i++) {
            if (isPrime(i)) {
                System.out.print(i + " ");
                count++;
            }
        }
        
        System.out.println("\nTotal number of prime numbers between 101 and 200: " + count);
    }
    
    // 判断一个数是否为素数的辅助方法
    public static boolean isPrime(int num) {
        if (num <= 1) {
            return false;
        }
        for (int i = 2; i <= Math.sqrt(num); i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}